﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Carwash.CW_Storage;

namespace Carwash.CW_Management
{
    class LogPrinter
    {
        CW_Storage_Facade storage_facade = new CW_Storage_Facade();

        public string printLogs()
        {
            return "CURRENTLOGS";
        }

        public string displayLogs(){
            string displayedLogs = "";
            ArrayList logs = storage_facade.retrieveLogs();
            if (logs == null){
                displayedLogs = "There are no logs to display";
            } else{
                foreach(string currentLog in logs)
                {
                    displayedLogs += String.Format(currentLog,"","","","Deluxe", "Ultra", "Super");
                    displayedLogs += System.Environment.NewLine;
                }
            }
            return displayedLogs;
        }

        public void clearLogs()
        {
            if (System.IO.File.Exists("storage/logs.txt"))
            {
                System.IO.File.Delete("storage/logs.txt");
            }
            System.IO.File.Create("storage/logs.txt");
        }

        public bool addLogEntry(string newLog)
        {
            return false;
        }
    }
}
